package com.qn.common.base;

import cn.dev33.satoken.stp.StpUtil;
import com.qn.common.base.model.BaseEntity;
import com.qn.core.resources.ResourcesSession;

/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
public class BaseServiceImpl< T extends BaseEntity>  implements IBaseService<T> {
    public String getUserName() {
        Object obj = StpUtil.getSession().get(ResourcesSession.USER_NAME);
        if (obj == null) {
            return null;
        }
        return String.valueOf(obj);
    }
    public Integer getLoginId() {
        Object obj = StpUtil.getLoginId();
        if (obj == null) {
            return null;
        }
        return Integer.valueOf(obj.toString());
    }
}